package org.joy;

import io.lettuce.core.RedisClient;
import io.lettuce.core.RedisURI;
import io.lettuce.core.SslVerifyMode;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisCommands;

public class LettuceClient {
    public static void main(String[] args) {
        RedisClient redisClient = RedisClient
                .create(RedisURI.Builder.redis("143.47.113.91",6379).
                        withSsl(true).withVerifyPeer(SslVerifyMode.CA).
                        build());
        StatefulRedisConnection<String, String> connection = redisClient.connect();
        RedisCommands<String, String> syncCommands = connection.sync();

        String v = syncCommands.get("key");
        System.out.println(v);

        connection.close();
        redisClient.shutdown();
    }
}
